翻訳と辞書
Words near each other
・ Lexical approach
・ Lexical aspect
・ Lexical chain
・ Lexical choice
・ Lexical correspondence
・ Lexical database
・ Lexical decision task
・ Lexical definition
・ Lexical density
・ Lexical diffusion
・ Lexical diversity
・ Lexical entrainment
・ Lexical field theory
・ Lexical function
・ Lexical functional grammar
Lexical grammar
・ Lexical hypothesis
・ Lexical item
・ Lexical lists
・ Lexical Markup Framework
・ Lexical resource
・ Lexical rule
・ Lexical semantics
・ Lexical set
・ Lexical similarity
・ Lexical simplification
・ Lexical substitution
・ Lexical verb
・ Lexical-gustatory synesthesia
・ Lexicalization


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Lexical grammar : ウィキペディア英語版
Lexical grammar
In computer science, a lexical grammar is a formal grammar defining the syntax of tokens. The program is written using characters that are defined by the lexical structure of the language used. The character set is equivalent to the alphabet used by any written language. The lexical grammar lays down the rules governing how a character sequence is divided up into subsequences of characters, each part of which represents an individual token. This is frequently defined in terms of regular expressions.
For instance, the lexical grammar for many programming languages specifies that a string literal starts with a " character and continues until a matching " is found (escaping makes this more complicated), that an identifier is an alphanumeric sequence (letters and digits, usually also allowing underscores, and disallowing initial digits), and that an integer literal is a sequence of digits. So in the following character sequence "abc" xyz1 23 the tokens are ''string'', ''identifier'' and ''number'' (plus whitespace tokens) because the space character terminates the sequence of characters forming the identifier. Further, certain sequences are categorized as keywords – these generally have the same form as identifiers (usually alphabetical words), but are categorized separately; formally they have a different token type.
==Examples==
Regular expressions for common lexical rules follow (for example, C).
Unescaped string literal (quote, followed by non-quotes, ending in a quote):
"()
*"
Escaped string literal (quote, followed sequence of escaped characters or non-quotes, ending in a quote):
"(\.|())
*"
Integer literal:
()+
Decimal integer integer (no leading zero):
()()
*|0
Hexadecimal integer literal:
0()()+
Octal integer literal:
0()
*
Identifier:
()()
*

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Lexical grammar」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.